---
title: "When a conspiracy theory goes mainstream, people feel more positive towards conspiracy theorists"
author: "REDACTED"
output: pdf_document
header-includes:
- \usepackage{caption}
- \captionsetup[table]{labelformat=empty}
- \captionsetup[figure]{labelformat=empty}
- \usepackage{floatrow}
- \floatsetup[figure]{capposition=top}
- \floatsetup[table]{capposition=top}
---

```{r package, echo = F, include=F}

knitr::opts_chunk$set(fig.width=5, fig.height=5) 
knitr::opts_chunk$set(tidy.opts = list(width.cutoff = 60), tidy = TRUE)

rm(list=ls())


options(scipen=999)

  pkgs <- c("dplyr", "ggplot2", "stargazer", "car", "tidyverse", "extrafont", "plyr", "haven", "coefplot", "broom")
# A function to load all above packages. Install if they have not been installed.
  usePackage <- function(p){
    for (pkg in p){
      if (!is.element(pkg, installed.packages()[,1]))
        install.packages(pkg, dep = TRUE, repos = "https://cloud.r-project.org/")
      require(pkg, character.only = TRUE)
    }
  }
  usePackage(pkgs)
  
 # loadfonts()

```

\section{Experimental Set-Up, Coding Variables, and Descriptive Data}

I used simple randomization to give respondents a two-thirds chance of participating in the control condition (not reading any article in the first wave). The result was that 521 respondents out of 1,545 total were in the treatment group and the other 1,024 were in the control group. 37 respondents completed the survey after the NYT article detailing the result of the Department of Defense UFO report appeared online at 7:55pm Eastern Time on June 3. Controlling for this made no difference to the results.

```{r , echo = T, include = T, warning = F}

set.seed(1234567)

d <- as.data.frame(read.csv("anonymousdata.csv"))


d$AlienTreatment <- ifelse(d$UFOGroup == "bipartisan", 1, 0)

d$Democrat <- ifelse(d$political_party.x == 1 |d$political_party.x == 2 | d$political_party.x == 3 |d$political_party.x == 6, 1, 0)
d$Republican <- ifelse(d$political_party.x == 5 |d$political_party.x == 9 | d$political_party.x == 10 | d$political_party.x == 8, 1, 0)


d$OutPartyFT0 <- ifelse(d$Democrat == 1, d$FTs_8, 'NA')
d$OutPartyFT <- as.numeric(ifelse(d$OutPartyFT0 == 'NA' & d$Republican == 1, d$FTs_7, d$OutPartyFT0))


d$InPartyFT0 <- ifelse(d$Democrat == 1, d$FTs_7, 'NA')
d$InPartyFT <- as.numeric(ifelse(d$InPartyFT0 == 'NA' & d$Republican == 1, d$FTs_8, d$InPartyFT0))

d$AffectivePol <- (d$InPartyFT - d$OutPartyFT)/2

d$AfterNYT <- ifelse(d$EndDate.x > "6/3/21 17:55", 1, 0)

d$ConspiracyFT <- d$FTs_9



# Partisan identity

d$DemIdentity <- (d$DemID1 + d$DemID2 + d$DemID3 + d$DemID4)/17
d$RepIdentity <- (d$RepID1 + d$RepID2 + d$RepID3 + d$RepID4)/17

d$PartisanIdentity0 <- ifelse(d$Democrat == 1, d$DemIdentity, 'NA')
d$PartisanIdentity <- as.numeric(ifelse(d$PartisanIdentity0 == 'NA' & d$Republican == 1, d$RepIdentity, d$PartisanIdentity0))

## PARTISAN IDENTITY WITH NONIDENTIFIERS AT 0 

d$PartisanIdentity2 <- ifelse(is.na(d$PartisanIdentity) == T, 0, d$PartisanIdentity)

## Demographics

## 1 = 18-29; 2= 30-49; 3 = 50 - 69; 4 = 70+
#summary(as.factor(d$age.x))
d$Age <- d$age.x

summary(as.factor(d$gender.x))
d$Male <- ifelse(d$gender.x == 1, 1, 0)

summary(as.factor(d$ethnicity.x))
summary(as.factor(d$hispanic.x))


## -3 = Extremely Conservative; 3 = Extremely Liberal
summary(as.factor(d$Ideology))


## Democrats
summary(as.factor(d$Democrat))

## Republicans
summary(as.factor(d$Republican))

## Education: 1 = LT HS; 2 = High school; 3 = Other post HS; 4 = Some college; 5 = AS; 6 = BA; 7 = MA; 8 = PhD
d$Education <- as.numeric(ifelse(d$education.x == -3105 | d$education.x == 10, "NA", d$education.x))
summary(as.factor(d$education.x))

## Income (increasing), 1 = less than 15k; 24 = more than 250k

d$Income <- as.numeric(ifelse(d$hhi.x == -3105, "NA", d$hhi.x))

## Region: 1 = Northeast; 2 = Midwest; 3 = South; 4 = West

d$Region <- d$region.x



## IDEOLOGUE

d$Liberal <- ifelse(d$Ideology > 0, d$Ideology, 0)
d$Conservative <- ifelse(d$Ideology <0, d$Ideology, 0)

## PARTISAN / NO LEAN / LEANER

d$Partisan <- ifelse(d$Democrat == 1 | d$Republican == 1, 1, 0)

d$PartisanNoLean <- ifelse( d$political_party.x != 6 & d$political_party.x != 8 & d$political_party.x != 3 & d$political_party.x != 5, d$Partisan, 0)

d$Leaner2 <- ifelse(d$political_party.x == 6 | d$political_party.x == 8 | d$political_party.x == 3 |d$political_party.x == 5, 1, 0)

#d$Ideologue <- ifelse(d$Ideology > 0 | d$Ideology <0 | d$Ideology2 >0 | d$Ideology2 <0 , 1, 0)

### Conspiracy model

Treatment <- d$AlienTreatment
Democrat <-d$Democrat
Republican <- d$Republican

balancecheck <- lm(Treatment ~ Democrat + Republican + Age + Male + ethnicity.x + Education + Income, data = d)

```


```{r, results = 'asis', echo = F}
stargazer(d, header = F, keep =c("Democrat", "Republican", "Age", "Male", "Education", "ethnicity.x", "Income"), digits = 2, title = "Table S1: Descriptive statistics for respondents")

```
\clearpage 
\section{Balance Check}
```{r, results = 'asis', echo = F, warning = F}
stargazer(balancecheck, digits = 2, header = F,title = "Balance Check")
```

\clearpage 
\section{Main Results}

```{r, echo = T, include = T, warning = F}
m0 <- lm(d$ConspiracyFT ~ Democrat + Republican +Treatment +d$AfterNYT  )

m1 <- lm(d$ConspiracyFT ~ Democrat + Republican +Treatment   )

m2<-lm(d$ConspiracyFT ~ Treatment)

conspiracyplot<-coefplot(m1,  color = "black", zeroColor = "black", fillColor = "black",intercept = F, title ="") + scale_color_manual(values=c("black","grey"))+
  theme( axis.line.y = element_blank(), axis.ticks.y=element_blank())+ theme(text         = element_text(size=10, family="LM Roman 10")) + labs(title = "How do you feel towards people who \n believe in conspiracy theories?" , x="Coefficient", y = "")+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) +theme(plot.title = element_text(hjust = 0.5, family = "LM Roman 10"))  +theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black"))+ theme(legend.position = "none")   



#ggsave(filename="conspiracyplot.jpeg", plot=conspiracyplot, device="jpeg", path=path, height=5, width=5, units="in", dpi=500)



```

```{r, results = 'asis', echo = F, warning = F}

stargazer(m2, digits = 2, header = F,title = "Experiment Results")

stargazer(m1, digits = 2, header = F,title = "Experiment Results")

```

\clearpage 
\section{Recontact Study}

```{r, warning = F}




d2 <- subset(d, AlienTreatment == 0 & is.na(d$R_FTs_9) == F)

d2$ConspiracyFTPost <- d2$R_FTs_9

t.test(d2$ConspiracyFTPost , d2$ConspiracyFT)


```
```{r, results = 'asis', echo = F, warning=F}
stargazer(subset(d2, select=c("ConspiracyFT","ConspiracyFTPost")), digits = 2, header = F)
```
